# $Header: /home/johnl/flnb/code/sql/RCS/Makefile,v 2.1 2009/11/08 02:53:39 johnl Exp $
# Companion source code for "flex & bison", published by O'Reilly
# Media, ISBN 978-0-596-15597-1
# Copyright (c) 2009, Taughannock Networks. All rights reserved.
# See the README file for license conditions and contact info.

CC = cc -g
LEX = flex
YACC = bison
CFLAGS = -DYYDEBUG=1

all: main

# chapter 4

main:	parser.tab.o lex.yy.o
	${CC} -o $@ parser.tab.o lex.yy.o -ly

parser.tab.c parser.tab.h:	parser.y
	${YACC} -vd parser.y --debug

lex.yy.c:	scanner.l
	${LEX} -o $@ $<

lex.yy.o:	lex.yy.c parser.tab.c

clean:
	rm -f main parser.tab.c parser.tab.h parser.tab.o lex.yy.c lex.yy.o parser.output

.SUFFIXES:	.l .y .c

